package com.bwie.doctorclient.mapper;

import com.bwie.doctorclient.domain.po.CommonlyPrescriptionPO;
import com.bwie.doctorclient.domain.po.DosagePO;
import com.bwie.doctorclient.domain.vo.DosageVO;
import com.bwie.doctorclient.domain.vo.PrescriptionVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OldPrescriptionsMapper {
    /**
     * 医生查询历史处方列表
     * @param doctorId
     * @return
     */
    List<PrescriptionVO> getOldPrescriptions(@Param("doctorId") Long doctorId);

    /**
     * 根据历史处方id查询历史处方中的药品用法用量信息
     * @param id
     * @return
     */
    List<DosageVO> getDosageByPrescriptionId(@Param("prescriptionId") Long id);

    /**
     * 根据id查询历史处方信息
     * @return
     */
    CommonlyPrescriptionPO getOldPrescriptionById(Long prescriptionId);

    /**
     * 根据id删除药品用法用量信息
     * @param dosageId
     */
    void delDosage(Long dosageId);

    /**
     * 根据药品用法用量id删除历史处方药品用法用量中间表
     * @param dosageId
     */
    void delDosageRelationByDosageId(Long dosageId);

    /**
     * 编辑历史药品用法用量
     * @param
     * @return
     */
    void updDosage(DosagePO dosagePO);

    /**
     * 新增历史处方药品
     * @param dosagePO
     */
    void addDosage(DosagePO dosagePO);

    /**
     * 新增历史处方药品用法用量中间表
     * @param prescriptionId
     * @param dosageId
     */
    void addDosageRelation(@Param("prescriptionId") Long prescriptionId, @Param("dosageId") Long dosageId);
}
